package com.siyu.template;

import lombok.Setter;

/**
 * @Author: siyu
 * @CreateTime: 2024-10-07
 * @Version: 1.0
 */
@Setter
public abstract class AbstractCourse {
    private boolean needCheckHomework;

    public final void createCourse(){
        //1、发布预习资料
        postPreResouces();
        //2、制作课件
        createPpt();
        // 直播授课
        liveVideo();
        // 布置作业
        postHomework();

        if (needCheckHomework()){
            CheckHomework();
        }
    }

    protected abstract void CheckHomework();

    protected boolean needCheckHomework(){
        return this.needCheckHomework;
    }

    private void postHomework() {
        System.out.println("布置作业");
    }

    private void liveVideo() {
        System.out.println("直播授课");
    }

    private void createPpt() {
        System.out.println("制作课件");
    }

    private void postPreResouces() {
        System.out.println("发布课程资料");
    }
}
